<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<c:set var="title">银行贷款情况</c:set>
<c:if test="${not empty param.title }"><c:set var="title">${param.title }</c:set></c:if>

<div class="t_bar2">
	<span class="color_red">*</span>${title }（温馨提示：不同银行分别填制。单位：万元，保留两位小数）
</div>
<table  id="tblExecuteProducts" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0">
		<thead>
		<tr>
			
			<th class="TblHead" align="center" width="5%"  >序号</th>
			<th class="TblHead" align="center" width="20%">设备名称</th>
			<th class="TblHead" align="center" width="15%">设备型号</th>
			<th class="TblHead" align="center" width="16%">生产国别</th>
			<th class="TblHead" align="center" width="10%">生产厂家</th>
			<th class="TblHead" align="center" width="10%">设备数量</th>
			<th class="TblHead" align="center" width="10%">设备总价</th>
			<th class="TblHead" align="center" width="10%">申请财政资金</th>
			<th class="TblHead" align="center" width="4%" >操作</th>
			<!-- <th class="TblHead" align="center" width="6%">申请贴息年度</th>
			<th class="TblHead" align="center" width="10%">首笔付息日期</th> -->
			</tr>
		</thead>
	<tbody>
	
		<c:set value="0" var="index" scope="page" />
		<x:forEach select="$xmlData/data/loans/loan" var="loan">
				<c:choose>
					<c:when test="${index<10}">
						<c:set value="0" var="flag" scope="page" />
					</c:when>
					<c:otherwise>
						<c:set value="" var="flag" scope="page" />
					</c:otherwise>
				</c:choose>
				<tr align="center">
					<td  style="display: none;">
			 			<input type="radio" class="radiobutton" name="selExecuteProducts" onclick=""/>
			 			<input type="hidden" name="loans/loan[${flag}${index}]/xmldata" value="<x:out select="$loan/xmldata"/>"/>
			 		</td>
			 		<td  >
			 			<span name="loans/loan[${flag}${index}]@seq_no" ><x:out select="$loan/@seq_no"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/fac_name" ><x:out select="$loan/basicinfo/fac_name"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/fac_model" ><x:out select="$loan/basicinfo/fac_model"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/country" ><x:out select="$loan/basicinfo/country"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/factory" ><x:out select="$loan/basicinfo/factory"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/fac_num" ><x:out select="$loan/basicinfo/fac_num"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/fac_total" ><x:out select="$loan/basicinfo/fac_total"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/app_fund" ><x:out select="$loan/basicinfo/app_fund"/></span>
			 		</td>
			 		<td>
			 			<a href="#" onclick="ViewDetail(this)" style ="color:blue">查看</a>
			 		</td>
				</tr>
				<c:set value="${index+1}" var="index" scope="page" />
		</x:forEach>
		</tbody>
</table>
<div class="t_bar2">
	试制设备费预算明细表
</div>

<table  id="heisi_wangkun" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;table-layout: fixed;" >
		
			<col width="10%" />
			<col width="25%" />
			<col width="20%" />
			<col width="20%" />
			<col width="25%" />
			<thead >
					<tr style="border:1px solid #B7D1E6">
						
						<th class="TblHead" align="center" >序号</th>
						<th class="TblHead" align="center" >试制设备工作内容</th> 
						<th class="TblHead" align="center" >经费预算</th> 
				     	<th class="TblHead" align="center" >申请财政资助</th> 
						<th class="TblHead" align="center" >与项目实施关系</th> 
						
					</tr>
			
			</thead>
			<tbody id="tab">
	
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/heisi_wangkun/list" var="list">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr align="center">
						
						<td align="center">
							<span name="heisi_wangkun/list[${flag}${index}]@seq_no" ><x:out select="$list/@seq_no"/></span> 
						</td>
						<td>
							<x:out select="$list/content"/>
						</td>
						
						<td align="center">
							<x:out select="$list/budget"/>
						</td> 
						<td align="center">
							<x:out select="$list/application"/>
						</td>
						<td>
							<x:out select="$list/remark"/>
						</td>
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					
				</tbody>
				</table>
		<table   cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;" id="budgetsMsg4">
	
			<col width="10%" />
			<col width="25%" />
			<col width="20%" />
			<col width="20%" />
			<col width="25%" />
			<tr align="center">
				<td colspan="2">合     计</td>
				<td><x:out select="$xmlData/data/heisi_wangkun_list/budget_total" /></td>
				<td><x:out select="$xmlData/data/heisi_wangkun_list/application_total" /></td>
				<td align="center">/</td>
				
			</tr>
		
		</table>

	
<div class="t_bar2">
	设备改造与租赁费明细表
</div>

<table  id="transformation_lease" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;table-layout: fixed;" >
		
			<col width="10%" />
			<col width="25%" />
			<col width="20%" />
			<col width="20%" />
			<col width="25%" />
			<thead >
					<tr style="border:1px solid #B7D1E6">
			
						<th class="TblHead" align="center" >序号</th>
						<th class="TblHead" align="center" >设备改造与租赁工作内容</th> 
						<th class="TblHead" align="center" >经费预算</th> 
				     	<th class="TblHead" align="center" >申请财政资助</th> 
						<th class="TblHead" align="center" >与项目实施关系</th> 
						
					</tr>
			
			</thead>
			<tbody id="tab">

					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/transformation_lease/list" var="list">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr align="center">
						
						<td align="center">
							<span name="transformation_lease/list[${flag}${index}]@seq_no" ><x:out select="$list/@seq_no"/></span> 
						</td>
						<td>
							<x:out select="$list/content"/>
						</td>
						
						<td align="center">
							<x:out select="$list/budget"/>
								
						</td> 
						<td align="center">
							<x:out select="$list/application"/>
						</td>
						<td>
							<x:out select="$list/remark"/>
						</td>
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					
				</tbody>
				</table>
		<table   cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;" id="budgetsMsg4">
			<col width="10%" />
		
			<col width="25%" />
			<col width="20%" />
			<col width="20%" />
			<col width="25%" />
			<tr align="center">
				<td colspan="2">合     计</td>
				<td><x:out select="$xmlData/data/transformation_lease/budget_total" /></td>
				<td><x:out select="$xmlData/data/transformation_lease/application_total" /></td>
				<td align="center">/</td>
				
			</tr>
		
</table>

	

<div class="t_bar2">
	化验加工费预算明细表
</div>

<table  id="assay" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;table-layout: fixed;" >
			<col width="10%" />
		
			<col width="25%" />
			<col width="25%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<thead >
					<tr style="border:1px solid #B7D1E6">
		
						<th class="TblHead" align="center" >序号</th>
						<th class="TblHead" align="center" >测试化验加工的内容</th> 
						<th class="TblHead" align="center" >测试化验加工单位</th> 
				     	<th class="TblHead" align="center" >计量单位</th> 
						<th class="TblHead" align="center" >单价<br/>（元/单位数量）</th> 
						<th class="TblHead" align="center" >数量</th> 
						<th class="TblHead" align="center" >金额</th> 
						
					</tr>
			
			</thead>
			<tbody id="tab">

					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/assay/list" var="list">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr align="center">
						
						<td align="center">
							<span name="transformation_lease/list[${flag}${index}]@seq_no" ><x:out select="$list/@seq_no"/></span> 
						</td>
						<td>
							<x:out select="$list/content"/>
						</td>
						<td>
							<x:out select="$list/org"/>
						</td>
						<td>
							<x:out select="$list/measure"/>
						</td>
						<td align="center">
							<x:out select="$list/price"/>
						</td>
						<td align="center">
							<x:out select="$list/amount"/>
						</td>
						<td align="center">
							<x:out select="$list/money"/>
						</td>
						
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					
				</tbody>
				</table>
		<table   cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;" id="budgetsMsg4">
			<col width="10%" />

			<col width="25%" />
			<col width="25%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<tr align="center">
				<td colspan="2">量大及价高测试化验费合计</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">
					<x:out select="$xmlData/data/proposal/expensive"/>
				</td>
				
			</tr>
				<tr align="center">
				<td colspan="2">其他测试化验费</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td>
				<x:out select="$xmlData/data/proposal/other_assay"/>
				</td>
			</tr>
			<tr align="center">
				<td colspan="2">合     计</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">
					<x:out select="$xmlData/data/proposal/assay_total"/>
				</td>
				
			</tr>

	</table>	

<div class="t_bar2">
	承担单位研究经费支出预算明细表
</div>

<table  id="undertaker" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;table-layout: fixed;" >
			<col width="10%" />
		
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			
			<thead >
					<tr style="border:1px solid #B7D1E6">
						
						<th class="TblHead" align="center"  rowspan="2">序号</th>
						<th class="TblHead" align="center"  rowspan="2">单位名称</th> 
						<th class="TblHead" align="center"  rowspan="2">组织机构代码</th> 
				
						<th class="TblHead" align="center"  rowspan="2">承担单位类型</th>
						<th class="TblHead" align="center"  rowspan="2">任务分工</th>
						<th class="TblHead" align="center"  rowspan="2">研究任务负责人</th>  
						<th class="TblHead" align="center"  rowspan="2">合计</th>
						<th class="TblHead" align="center"  colspan="2">专项经费</th>  
						<th class="TblHead" align="center"  rowspan="2">自筹经费</th>             
					</tr>
					<tr style="border:1px solid #B7D1E6"> 
				      <th class="TblHead" align="center">小计</th>  
						<th class="TblHead" align="center">其中：间接费用</th>      
					</tr>
			</thead>
			<tbody id="tab">
					
					
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/undertaker/list" var="list">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr align="center">
						
						<td align="center">
							<span name="undertaker/list[${flag}${index}]@seq_no" ><x:out select="$list/@seq_no"/></span> 
						</td>
						<td>
							<x:out select="$list/name"/>
						</td>
						<td style="text-align: center;">
				        	<x:out select="$list/org_code"/>
			         </td>
			         <td>
			         	<x:out select="$list/org_type_name" />
			         </td>
			         <td style="text-align: center;">
				        <x:out select="$list/division"/>
			         </td>
			          <td style="text-align: center;">
				         <x:out select="$list/division_psn"/>
			         </td>
			         
						<td>
							<x:out select="$list/total"/>
						</td> 
						<td>
							<x:out select="$list/special_fund"/>
						</td> 
						<td>
							<x:out select="$list/special_indirect"/>
						</td> 
						<td>
							<x:out select="$list/self_fund"/>
						</td> 
						
						
						
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					
				</tbody>
				</table>
		<table   cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;" id="budgetsMsg4">
			<col width="10%" />
	
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<tr align="center">
				<td colspan="6">合     计</td>
				<td>
					<x:out select="$xmlData/data/proposal/undertaker_total"/>
				</td>
				<td>
					<x:out select="$xmlData/data/proposal/special_fund_total"/>
				</td>
				<td>
					<x:out select="$xmlData/data/proposal/special_indirect"/>
				</td>
				<td>
					<x:out select="$xmlData/data/proposal/self_fund"/>
				</td>
				
			</tr>
		
			
		</table> 

<script type="text/javascript">
	//添加
	
	
	//查看
	function ViewDetail(obj) {
		var radioname = "selExecuteProducts";
		var tr = obj.parentElement.parentElement;
		var selectedRow = tr;
		var xmldata = $(selectedRow).find("input[name$='xmldata']").val();
		$(selectedRow).find(":radio").attr("checked","checked");
		if (xmldata == "")
			xmldata = "<data></data>";
		xmlEncrypt(xmldata);
		editRow('tblExecuteProducts', "${ctx}/proposal/edit/equipment/"
				+ 'loansInfo' + "?flag=view"
				+ "&TB_iframe=true&width=900", '查看');
	} 

	
	//重写 查看时不必检查 是否选择
	function editRow2(tableId,url,title)
		{
		if(url!=null&&url!=""){
			showThickBox(url,title);
		}
		} 
	
	function getSelectedRow(radioname) {
		var selectedRadio = $("input[name=" + radioname + "]:checked").get(0);
		// public.js 已做此检查
		/* if (selectedRadio == null) {
			alert("请先选择一条记录！");
			return null;
		} */
		var tr = $(selectedRadio).parents("tr").get(0);
		return tr;

	}

	/**
	 * 打开页面查看内容
	 * @param tableId 表格id
	 * @param startRowIndex 起始行
	 * @param url 跳转url
	 * @param selObj 没有选中行,就指当前对象所在行
	 */
	function viewRow(tableId, url, title, selObj) {
		if (selObj) {

		}
		if (url != null && url != "") {
			showThickBox(url, title);
		}
	}

	function xmlEncrypt(strXmlData) {

		var xmlHttpRequest;
		if (window.ActiveXObject) //IE和其他的浏览器实现XMLHttpRequest的方式不同

		{
			xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		} else {
			xmlHttpRequest = new XMLHttpRequest();
		}

		var url = ctx + '/ajax/ajaxEncrypt';
		xmlHttpRequest.open('POST', url, false);
		xmlHttpRequest.setRequestHeader("Content-Type",
				"application/x-www-form-urlencoded");
		xmlHttpRequest.send("&xmldata=" + encodeURIComponent(strXmlData));
		return xmlHttpRequest.responseText;

	}
</script>


